#ifndef __UXML_NODE_H__
#define __UXML_NODE_H__

#include "zCore.h"
#include "xNonCopyable.h"

#include <libxml/tree.h>
#include <string>

namespace ck
{
	namespace xml
	{
		class TextNode;

		class ZCORE_API Node : public NonCopyable
		{
		public:		
			Node(xmlNodePtr pxNode);
			virtual ~Node();

		public:
			const char*		GetName();
			bool			SetName(const char* name);
			Node*			AddChild(const char* name, const char* nspace = NULL);

			TextNode*		GetChildTextNode();

			void			Reset();
			Node*			NextChild();

		protected:
			xmlNodePtr		CreateNewChildNode(const char* name, const char* nspace);

		protected:
			xmlNodePtr		m_pxNode;
			xmlNodePtr		m_pxChild;

			std::string		m_name;
			std::string		m_content;
			std::string		m_text;
		};
	}
}



#endif //__UXML_NODE_H__
